﻿var status = 0;

var time = java.util.Calendar.getInstance();
var year = time.get(java.util.Calendar.YEAR);           //获得年份
var month = time.get(java.util.Calendar.MONTH) + 1;     //获得月份
var day = time.get(java.util.Calendar.DATE);            //获取日
var hour = time.get(java.util.Calendar.HOUR_OF_DAY);    //获得小时
var minute = time.get(java.util.Calendar.MINUTE);       //获得分钟
var second = time.get(java.util.Calendar.SECOND);       //获得秒
//var eff1 = "#fEffect/CharacterEff/1114000/1/0#"; //红星花
//var eff1 = "#fUI/StarCityUI.img/GradeInfo/icon_ss/7#"
var eff1 = "#fEffect/CharacterEff/1112949/3/0#"; //花样音符
//var eff1 = "#fUI/StarCityUI.img/GradeInfo/icon_ss/7#"
var z = "#fUI/UIWindow/Quest/icon5/1#";//"+z+"//美化
var w ="#fEffect/CharacterEff/1051296/1/0#";
var p2 ="#fUI/SoulUI.img/DungeonMap/icon/dungeonItem/0#"
var tz12 = "#fEffect/CharacterEff/1112924/0/0#";  //黄星
var tz13 = "#fEffect/CharacterEff/1112925/0/0#";  //蓝星

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (status == 0 && mode == 0) {
        cm.dispose();
        return;
    }
    if (mode == 1) {
        status++;
    } else {
        status--;
    }
    if (cm.getMapId() == 180000001) {
            cm.sendOk("很遗憾，您因为违反用户守则被禁止游戏活动，如有异议请联系管理员.")
            cm.dispose();
        } else if (status == 0) {
        var selStr = "\t"+"欢迎来到" + cm.getServerName() + "冒险岛.以下是个人专区#k\r\n";


		selStr += "#L0#" + tz13 +"#d每日签到#l";
                selStr += "#L1#" + tz13 +"#d活跃查询#l";
		selStr += "#L7#" + tz13 +"#d新手神器#l\r\n\r\n";
		selStr += "#L2#" + tz13 +"#d登录奖励#l";
		selStr += "#L3#" + tz13 +"#d在线奖励#l";
		selStr += "#L6#" + tz13 +"#d等级奖励#l\r\n\r\n";
		selStr += "#L4#" + tz12 +"#r职业转职#l";
		selStr += "#L5#" + tz12 +"#r一键五转#l\r\n\r\n";

		


		        cm.sendSimple(selStr);
    } else if (status == 1) {
        switch (selection) {
		 case 0://每日签到
			cm.dispose();
            cm.openNpc(0, "每日签到");
            break;
         case 1://个活跃查询
			cm.dispose();
			cm.openNpc(0, "活跃查询");
            break;
         case 2://登录奖励
			cm.dispose();
			cm.openNpc(0, "登录奖励");          
			break;
         case 3://在线奖励
	               cm.worldSpouseMessage(0x18,"[奖励更新]: 新【在线奖励】已上线！！")
                       cm.dispose();
                       cm.openNpc(0, "在线奖励");
            break;
          case 4://转职系统
			cm.dispose();
			cm.openNpc(0, "转职系统");
            break;
          case 5://一键五转
                        cm.dispose();
                        cm.openNpc(0, "一键五转");
            break;
	    case 6:
            cm.dispose();
            cm.openNpc(0, "等级奖励");
            break;

	    case 7:
            cm.dispose();
            cm.openNpc(0, "新手神器");
            break;

		}
    }
}